<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelProfileProxy extends \XLite\Model\Profile implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Profile';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function getProfileId()
    {
        $this->_load();
        return parent::getProfileId();
    }

    public function setLogin($login)
    {
        $this->_load();
        return parent::setLogin($login);
    }

    public function getLogin()
    {
        $this->_load();
        return parent::getLogin();
    }

    public function setPassword($password)
    {
        $this->_load();
        return parent::setPassword($password);
    }

    public function getPassword()
    {
        $this->_load();
        return parent::getPassword();
    }

    public function setPasswordHint($passwordHint)
    {
        $this->_load();
        return parent::setPasswordHint($passwordHint);
    }

    public function getPasswordHint()
    {
        $this->_load();
        return parent::getPasswordHint();
    }

    public function setPasswordHintAnswer($passwordHintAnswer)
    {
        $this->_load();
        return parent::setPasswordHintAnswer($passwordHintAnswer);
    }

    public function getPasswordHintAnswer()
    {
        $this->_load();
        return parent::getPasswordHintAnswer();
    }

    public function setAccessLevel($accessLevel)
    {
        $this->_load();
        return parent::setAccessLevel($accessLevel);
    }

    public function getAccessLevel()
    {
        $this->_load();
        return parent::getAccessLevel();
    }

    public function setCmsProfileId($cmsProfileId)
    {
        $this->_load();
        return parent::setCmsProfileId($cmsProfileId);
    }

    public function getCmsProfileId()
    {
        $this->_load();
        return parent::getCmsProfileId();
    }

    public function setCmsName($cmsName)
    {
        $this->_load();
        return parent::setCmsName($cmsName);
    }

    public function getCmsName()
    {
        $this->_load();
        return parent::getCmsName();
    }

    public function setAdded($added)
    {
        $this->_load();
        return parent::setAdded($added);
    }

    public function getAdded()
    {
        $this->_load();
        return parent::getAdded();
    }

    public function setFirstLogin($firstLogin)
    {
        $this->_load();
        return parent::setFirstLogin($firstLogin);
    }

    public function getFirstLogin()
    {
        $this->_load();
        return parent::getFirstLogin();
    }

    public function setLastLogin($lastLogin)
    {
        $this->_load();
        return parent::setLastLogin($lastLogin);
    }

    public function getLastLogin()
    {
        $this->_load();
        return parent::getLastLogin();
    }

    public function setStatus($status)
    {
        $this->_load();
        return parent::setStatus($status);
    }

    public function getStatus()
    {
        $this->_load();
        return parent::getStatus();
    }

    public function setReferer($referer)
    {
        $this->_load();
        return parent::setReferer($referer);
    }

    public function getReferer()
    {
        $this->_load();
        return parent::getReferer();
    }

    public function setLanguage($language)
    {
        $this->_load();
        return parent::setLanguage($language);
    }

    public function getLanguage()
    {
        $this->_load();
        return parent::getLanguage();
    }

    public function setLastShippingId($lastShippingId)
    {
        $this->_load();
        return parent::setLastShippingId($lastShippingId);
    }

    public function getLastShippingId()
    {
        $this->_load();
        return parent::getLastShippingId();
    }

    public function setLastPaymentId($lastPaymentId)
    {
        $this->_load();
        return parent::setLastPaymentId($lastPaymentId);
    }

    public function getLastPaymentId()
    {
        $this->_load();
        return parent::getLastPaymentId();
    }

    public function addDrupalRoles(\XLite\Module\CDev\DrupalConnector\Model\DrupalRole $drupalRoles)
    {
        $this->_load();
        return parent::addDrupalRoles($drupalRoles);
    }

    public function getDrupalRoles()
    {
        $this->_load();
        return parent::getDrupalRoles();
    }

    public function getOrder()
    {
        $this->_load();
        return parent::getOrder();
    }

    public function getMembership()
    {
        $this->_load();
        return parent::getMembership();
    }

    public function getPendingMembership()
    {
        $this->_load();
        return parent::getPendingMembership();
    }

    public function addAddresses(\XLite\Model\Address $addresses)
    {
        $this->_load();
        return parent::addAddresses($addresses);
    }

    public function getAddresses()
    {
        $this->_load();
        return parent::getAddresses();
    }

    public function getCMSProfile()
    {
        $this->_load();
        return parent::getCMSProfile();
    }

    public function updateDrupalRoles($newDrupalRoles)
    {
        $this->_load();
        return parent::updateDrupalRoles($newDrupalRoles);
    }

    public function update($cloneMode = false)
    {
        $this->_load();
        return parent::update($cloneMode);
    }

    public function setMembership(\XLite\Model\Membership $membership = NULL)
    {
        $this->_load();
        return parent::setMembership($membership);
    }

    public function setPendingMembership(\XLite\Model\Membership $pendingMembership = NULL)
    {
        $this->_load();
        return parent::setPendingMembership($pendingMembership);
    }

    public function getMembershipId()
    {
        $this->_load();
        return parent::getMembershipId();
    }

    public function getPendingMembershipId()
    {
        $this->_load();
        return parent::getPendingMembershipId();
    }

    public function getBillingAddress()
    {
        $this->_load();
        return parent::getBillingAddress();
    }

    public function getShippingAddress()
    {
        $this->_load();
        return parent::getShippingAddress();
    }

    public function getOrdersCount()
    {
        $this->_load();
        return parent::getOrdersCount();
    }

    public function isEnabled()
    {
        $this->_load();
        return parent::isEnabled();
    }

    public function enable()
    {
        $this->_load();
        return parent::enable();
    }

    public function disable()
    {
        $this->_load();
        return parent::disable();
    }

    public function isAdmin()
    {
        $this->_load();
        return parent::isAdmin();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function isSameAddress()
    {
        $this->_load();
        return parent::isSameAddress();
    }

    public function isEqualAddress()
    {
        $this->_load();
        return parent::isEqualAddress();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function setOrder(\XLite\Model\Order $order = NULL)
    {
        $this->_load();
        return parent::setOrder($order);
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'drupalRoles', 'profile_id', 'login', 'password', 'password_hint', 'password_hint_answer', 'access_level', 'cms_profile_id', 'cms_name', 'added', 'first_login', 'last_login', 'status', 'referer', 'order', 'language', 'last_shipping_id', 'last_payment_id', 'membership', 'pending_membership', 'addresses');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}